package com.dlwx.firefighting.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.dlwx.firefighting.bean.LevelOneBean;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Administrator on 2017/12/5.
 */

public class MyPaperAdapter extends FragmentPagerAdapter {
    private List<LevelOneBean> beans;
    private ArrayList<Fragment> fragmentList;
    public MyPaperAdapter(FragmentManager fm, List<LevelOneBean> beans, ArrayList<Fragment> fragmentList) {
        super(fm);
        this.beans = beans;
        this.fragmentList = fragmentList;
    }

    @Override
    public Fragment getItem(int position) {
        return fragmentList.get(position);
    }

    @Override
    public int getCount() {
        return fragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return beans.get(position).getName();
    }
}
